// 装备信息
import request from "@/api/request";
// 分页查询装备
export const query_equip = (params) => {
  return request({
    url: "/essentialdata/pe/selectAll",
    method: "post",
    data: params,
  });
};

// 新增装备
export const add_equip = (params) => {
  return request({
    url: "/essentialdata/pe/insert",
    method: "post",
    data: params,
    headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};
// 分页查询装备分类树
export const select_equip = (params) => {
  return request({
    url: `/essentialdata/pe/selectEcTree/${params}`,
    method: "post",
    data: params,
  });
};

// 逻辑删除装备
export const delete_equip = (params) => {
  return request({
    url: `/essentialdata/pe/delete/${params}`,
    method: "post",
    data: params,
  });
};

// 修改装备
export const update_equip = (params) => {
  return request({
    url: "/essentialdata/pe/update",
    method: "post",
    data: params,
    headers: { "Content-Type": "application/json;charset=UTF-8" },
  });
};

// 查询装备详情
export const select_equipDetails = (params) => {
  return request({
    url: `/essentialdata/pe/selectDetails/${params}`,
    method: "post",
    data: params,
  });
};
// 删除子表信息
export const delete_equipParams = (params) => {
  return request({
    url: `/essentialdata/pep/delete/${params}`,
    method: "post",
    data: params,
  });
};

// 选择装备型号
export const select_equipModel = (params) => {
  return request({
    url: "/essentialdata/pe/setModel",
    method: "post",
    data: params,
    headers: { "Content-Type": "application/json" },
  });
};

// 查询参数子表
export const query_cstable = (params) => {
  return request({
    url: `/essentialdata/pep/selectAll/${params}`,
    method: "post",
    data: params,
  });
};

// 查询产品参数子表
export const query_selectParamDtl = (params) => {
  return request({
    url: "/essentialdata/dp/selectParamDtl",
    method: "post",
    data: params,
    headers: { "Content-Type": "application/json" },
  });
};

// 启用序列号管理
export const on_setEnable = (params) => {
  return request({
    url: `/pe/setEnable/${params}`,
    method: "post",
    data: params,
  });
};

// 停用序列号管理
export const off_setEnable = (params) => {
  return request({
    url: `/pe/setDisable/${params}`,
    method: "post",
    data: params,
  });
};

// 查询参数值
export const query_paramsValue = (params) => {
  return request({
    url: `/essentialdata/pep/selectparamid/${params}`,
    method: "post",
    data: params,
  });
};

// 查询参数信息
export const query_paramsInfo = (params) => {
  return request({
    url: "/essentialdata/pep/selectpardd/",
    method: "post",
    data: params,
  });
};

export const query_selectddcode = (params) => {
  return request({
    url: `/essentialdata/pep/selectDdInfo/${params}`,
    method: "post",
    data: params,
  });
};

// export const query_selectddcode = (params) => {
//   return request({
//     url: `/essentialdata/pep/selectddcode/${params}`,
//     method: "post",
//     data: params,
//   });
// };

// 生产商
export const select_Manufacturer = (params) => {
  return request({
    url: "/essentialdata/ed/producerList",
    method: "post",
    data: params,
    headers: { "Content-Type": "application/json" },
  });
};

// 型号
export const select_Model = (params) => {
  return request({
    url: "/essentialdata/ed/modelList",
    method: "post",
    data: params,
    headers: { "Content-Type": "application/json" },
  });
};

// 计量单位
export const select_UnitList = (params) => {
  return request({
    url: "/essentialdata/ed/unitList",
    method: "post",
    data: params,
    headers: { "Content-Type": "application/json" },
  });
};
